<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index')->name('admin.home');
    $router->resource('users', MemberController::class);
    $router->resource('channel', ChannelsController::class);
    $router->resource('article', ArticleController::class);
    $router->resource('comments', CommentController::class);
    $router->resource('navigations', NavigationController::class);
    $router->resource('website', WebSiteController::class);
    $router->resource('banners', BannersController::class);
    $router->resource('banners-thumbs', BannersThumbsController::class);


    $router->get('/api/admin','ApiController@admin');
    $router->get('/api/user','ApiController@user');

    $router->get('/grafana',function (){
        $content = app(Encore\Admin\Layout\Content::class);
        $content->title("性能监控");
        $content->breadcrumb( ['text' => '首页', 'url' => '/admin'],
            ['text' => '用户管理', 'url' => '/admin/users'],
            ['text' => '编辑用户']);
        $content->description("相关指标监控");
        $content->view('admin.grafana');
        return $content;
    });
});
